| Plant | Flowers | Date | lon | lat | ele | Month | Year | julian |
|---|---|---|---|---|---|---|---|---|
| Glossoloma oblongicalyx | 4 | 2015-10-19 | -78.59093 | 0.130838 | 2270 | October | 2015 | 292 |
| Gasteranthus quitensis | 2 | 2016-10-17 | -78.59770 | 0.120070 | 1940 | October | 2016 | 291 |
| Kohleria affinis | 1 | 2016-12-13 | -78.59534 | 0.126746 | 2110 | December | 2016 | 348 |
| Columnea ciliata | 3 | 2014-02-27 | -78.59934 | 0.116682 | 1960 | February | 2014 | 58 |
| Columnea medicinalis | 1 | 2014-04-23 | -78.59372 | 0.128700 | 2130 | April | 2014 | 113 |
| Drymonia teuscheri | 3 | 2016-07-28 | -78.59245 | 0.129393 | 2200 | July | 2016 | 210 |
| Plant | Flowers | Date | lon | lat | ele | Month | Year | julian |
|---|---|---|---|---|---|---|---|---|
| Glossoloma oblongicalyx | 4 | 2015-10-19 | -78.59093 | 0.130838 | 2270 | October | 2015 | 292 |
| Gasteranthus quitensis | 2 | 2016-10-17 | -78.59770 | 0.120070 | 1940 | October | 2016 | 291 |
| Kohleria affinis | 1 | 2016-12-13 | -78.59534 | 0.126746 | 2110 | December | 2016 | 348 |
| Columnea ciliata | 3 | 2014-02-27 | -78.59934 | 0.116682 | 1960 | February | 2014 | 58 |
| Columnea medicinalis | 1 | 2014-04-23 | -78.59372 | 0.128700 | 2130 | April | 2014 | 113 |
| Drymonia teuscheri | 3 | 2016-07-28 | -78.59245 | 0.129393 | 2200 | July | 2016 | 210 |
As range
## sink("model/threshold_baseline_elev.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #Occurrence at a given elevation
## logit(psi[x]) = alpha[Plant[x]] + beta[Plant[x]] * ele[x]
## z[x]~dbern(psi[x])
##
## #In Peak Flowering?
## logit(p[x]) = alpha_flowering[Plant[x]]
##
## #Observation of flowering|occurrence
## phi[x] = z[x] * p[x]
## Y[x] ~ dbern(phi[x])
##
## #Residuals
## discrepancy[x] <- abs(Y[x] - phi[x])
##
## #Assess Model Fit
## Ynew[x] ~ dbern(phi[x])
## discrepancy.new[x]<-abs(Ynew[x] - phi[x])
## }
##
## #Sum discrepancy
## fit<-sum(discrepancy)/Nobs
## fitnew<-sum(discrepancy.new)/Nobs
##
## ###########
## #Prediction
## ###########
##
## for(x in 1:Npreds){
##
## #Occurrence at a given elevation
## logit(psi_new[x]) = alpha[Plant_new[x]] + beta[Plant_new[x]] * ele_new[x]
## z_new[x]~dbern(psi_new[x])
##
## logit(p_new[x]) <- alpha_flowering[Plant[x]]
##
## #Observation of flowering|occurrence
## phi_new[x] = z_new[x] * p_new[x]
##
## #Observation - probability of flowering
## prediction[x] ~ dbern(phi_new[x])
##
## #predictive error
## pred_error[x] <- abs(Ypred[x] - prediction[x])
## }
##
## #Predictive Error
## fitpred<-sum(pred_error)/Npreds
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Prevalence
## alpha[j] ~ dnorm(0,0.386)
## alpha_flowering[j] ~ dnorm(0,0.386)
##
## #Effect of elevation on occurrence
## beta[j] ~ dnorm(0,0.386)
## }
##
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 2324
## Unobserved stochastic nodes: 5866
## Total graph size: 36558
##
## Initializing model
## sink("model/threshold_attraction_elev.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #Occurrence at a given elevation
## logit(psi[x]) = alpha[Plant[x]] + beta[Plant[x]] * ele[x]
## z[x]~dbern(psi[x])
##
## #In Peak Flowering?
## logit(p[x]) = e[Plant[x],Site[x],Month[x]]
##
## #Observation of flowering|occurrence
## phi[x] = z[x] * p[x]
## Y[x] ~ dbern(phi[x])
##
## #Residuals
## discrepancy[x] <- abs(Y[x] - phi[x])
##
## #Assess Model Fit
## Ynew[x] ~ dbern(phi[x])
## discrepancy.new[x]<-abs(Ynew[x] - phi[x])
## }
##
##
## #Sum discrepancy
## fit<-sum(discrepancy)/Nobs
## fitnew<-sum(discrepancy.new)/Nobs
##
## ###########
## #Prediction
## ###########
##
## for(x in 1:Npreds){
##
## #Occurrence at a given elevation
## logit(psi_new[x]) = alpha[Plant_new[x]] + beta[Plant_new[x]] * ele_new[x]
## z_new[x] ~ dbern(psi_new[x])
##
## logit(p_new[x]) = e[Plant_new[x],Site_new[x],Month_new[x]]
##
## #Observation of flowering|occurrence
## phi_new[x] = z_new[x] * p_new[x]
##
## #Observation - probability of flowering
## prediction[x] ~ dbern(phi_new[x])
##
## #predictive error
## pred_error[x] <- abs(Ypred[x] - prediction[x])
## }
##
## #Predictive Error
## fitpred<-sum(pred_error)/Npreds
##
## #########################
## #Autocorrelation in error
## #########################
##
## #For each of observation
## for(x in 1:Sites){
## for(y in 1:Months){
## e[1:Plants,x,y] ~ dmnorm(zeros,tauC[,])
## }
## }
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda_cov * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter, allow omega to shrink to identity matrix
## vCov = omega*C[,] + (1-omega) * I
## tauC=inverse(vCov*gamma)
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Prevalence
## alpha[j] ~ dnorm(0,0.386)
##
## #Effect of elevation on occurrence
## beta[j] ~ dnorm(0,0.386)
## }
##
## #Autocorrelation priors
## gamma ~ dunif(0.1,5)
##
## #Strength of covariance decay
## lambda_cov ~ dunif(0,5)
## omega = 1
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 2324
## Unobserved stochastic nodes: 5926
## Total graph size: 44893
##
## Initializing model
Mean phylogenetic covariance
## sink("model/threshold_repulsion_elev.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #Occurrence at a given elevation
## logit(psi[x]) = alpha[Plant[x]] + beta[Plant[x]] * ele[x]
## z[x]~dbern(psi[x])
##
## #In Peak Flowering?
## logit(p[x]) = e[Plant[x],Site[x],Month[x]]
##
## #Observation of flowering|occurrence
## phi[x] = z[x] * p[x]
## Y[x] ~ dbern(phi[x])
##
## #Residuals
## discrepancy[x] <- abs(Y[x] - p[x])
##
## #Assess Model Fit
## Ynew[x] ~ dbern(phi[x])
## discrepancy.new[x]<-abs(Ynew[x] - phi[x])
## }
##
##
## #Sum discrepancy
## fit<-sum(discrepancy)/Nobs
## fitnew<-sum(discrepancy.new)/Nobs
##
## ###########
## #Prediction
## ###########
##
## for(x in 1:Npreds){
##
## #Occurrence at a given elevation
## logit(psi_new[x]) = alpha[Plant_new[x]] + beta[Plant_new[x]] * ele_new[x]
## z_new[x]~dbern(psi_new[x])
##
## logit(p_new[x]) <- e[Plant_new[x],Site_new[x],Month_new[x]]
##
## #Observation of flowering|occurrence
## phi_new[x] = z_new[x] * p_new[x]
##
## #Observation - probability of flowering
## prediction[x] ~ dbern(phi_new[x])
##
## #predictive error
## pred_error[x] <- abs(Ypred[x] - prediction[x])
## }
##
## #Predictive Error
## fitpred<-sum(pred_error)/Npreds
##
## #########################
## #Autocorrelation in error
## #########################
##
## #For each of observation
## for(x in 1:Sites){
## for(y in 1:Months){
## e[1:Plants,x,y] ~ dmnorm(zeros,tauC[,])
## }
## }
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda_cov * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter, allow omega to shrink to identity matrix
## vCov = omega*C[,] + (1-omega) * I
## tauC=vCov*gamma
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Prevalence
## alpha[j] ~ dnorm(0,0.386)
##
## #Effect of elevation on occurrence
## beta[j] ~ dnorm(0,0.386)
## }
##
## #Autocorrelation priors
## gamma ~ dunif(0.1,5)
##
## #Strength of covariance decay
## lambda_cov ~ dunif(0,5)
## omega = 1
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 2324
## Unobserved stochastic nodes: 5926
## Total graph size: 42540
##
## Initializing model
Mean phylogenetic covariance martix
## sink("model/threshold_attraction_elev.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #Occurrence at a given elevation
## logit(psi[x]) = alpha[Plant[x]] + beta[Plant[x]] * ele[x]
## z[x]~dbern(psi[x])
##
## #In Peak Flowering?
## logit(p[x]) = e[Plant[x],Site[x],Month[x]]
##
## #Observation of flowering|occurrence
## phi[x] = z[x] * p[x]
## Y[x] ~ dbern(phi[x])
##
## #Residuals
## discrepancy[x] <- abs(Y[x] - phi[x])
##
## #Assess Model Fit
## Ynew[x] ~ dbern(phi[x])
## discrepancy.new[x]<-abs(Ynew[x] - phi[x])
## }
##
##
## #Sum discrepancy
## fit<-sum(discrepancy)/Nobs
## fitnew<-sum(discrepancy.new)/Nobs
##
## ###########
## #Prediction
## ###########
##
## for(x in 1:Npreds){
##
## #Occurrence at a given elevation
## logit(psi_new[x]) = alpha[Plant_new[x]] + beta[Plant_new[x]] * ele_new[x]
## z_new[x] ~ dbern(psi_new[x])
##
## logit(p_new[x]) = e[Plant_new[x],Site_new[x],Month_new[x]]
##
## #Observation of flowering|occurrence
## phi_new[x] = z_new[x] * p_new[x]
##
## #Observation - probability of flowering
## prediction[x] ~ dbern(phi_new[x])
##
## #predictive error
## pred_error[x] <- abs(Ypred[x] - prediction[x])
## }
##
## #Predictive Error
## fitpred<-sum(pred_error)/Npreds
##
## #########################
## #Autocorrelation in error
## #########################
##
## #For each of observation
## for(x in 1:Sites){
## for(y in 1:Months){
## e[1:Plants,x,y] ~ dmnorm(zeros,tauC[,])
## }
## }
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda_cov * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter, allow omega to shrink to identity matrix
## vCov = omega*C[,] + (1-omega) * I
## tauC=inverse(vCov*gamma)
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Prevalence
## alpha[j] ~ dnorm(0,0.386)
##
## #Effect of elevation on occurrence
## beta[j] ~ dnorm(0,0.386)
## }
##
## #Autocorrelation priors
## gamma ~ dunif(0.1,5)
##
## #Strength of covariance decay
## lambda_cov ~ dunif(0,5)
## omega = 1
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 2324
## Unobserved stochastic nodes: 5926
## Total graph size: 45049
##
## Initializing model
## sink("model/threshold_repulsion_elev.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #Occurrence at a given elevation
## logit(psi[x]) = alpha[Plant[x]] + beta[Plant[x]] * ele[x]
## z[x]~dbern(psi[x])
##
## #In Peak Flowering?
## logit(p[x]) = e[Plant[x],Site[x],Month[x]]
##
## #Observation of flowering|occurrence
## phi[x] = z[x] * p[x]
## Y[x] ~ dbern(phi[x])
##
## #Residuals
## discrepancy[x] <- abs(Y[x] - p[x])
##
## #Assess Model Fit
## Ynew[x] ~ dbern(phi[x])
## discrepancy.new[x]<-abs(Ynew[x] - phi[x])
## }
##
##
## #Sum discrepancy
## fit<-sum(discrepancy)/Nobs
## fitnew<-sum(discrepancy.new)/Nobs
##
## ###########
## #Prediction
## ###########
##
## for(x in 1:Npreds){
##
## #Occurrence at a given elevation
## logit(psi_new[x]) = alpha[Plant_new[x]] + beta[Plant_new[x]] * ele_new[x]
## z_new[x]~dbern(psi_new[x])
##
## logit(p_new[x]) <- e[Plant_new[x],Site_new[x],Month_new[x]]
##
## #Observation of flowering|occurrence
## phi_new[x] = z_new[x] * p_new[x]
##
## #Observation - probability of flowering
## prediction[x] ~ dbern(phi_new[x])
##
## #predictive error
## pred_error[x] <- abs(Ypred[x] - prediction[x])
## }
##
## #Predictive Error
## fitpred<-sum(pred_error)/Npreds
##
## #########################
## #Autocorrelation in error
## #########################
##
## #For each of observation
## for(x in 1:Sites){
## for(y in 1:Months){
## e[1:Plants,x,y] ~ dmnorm(zeros,tauC[,])
## }
## }
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda_cov * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter, allow omega to shrink to identity matrix
## vCov = omega*C[,] + (1-omega) * I
## tauC=vCov*gamma
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Prevalence
## alpha[j] ~ dnorm(0,0.386)
##
## #Effect of elevation on occurrence
## beta[j] ~ dnorm(0,0.386)
## }
##
## #Autocorrelation priors
## gamma ~ dunif(0.1,5)
##
## #Strength of covariance decay
## lambda_cov ~ dunif(0,5)
## omega = 1
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 2324
## Unobserved stochastic nodes: 5926
## Total graph size: 42696
##
## Initializing model
## sink("model/threshold_repulsion_elev.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #Occurrence at a given elevation
## logit(psi[x]) = alpha[Plant[x]] + beta[Plant[x]] * ele[x]
## z[x]~dbern(psi[x])
##
## #In Peak Flowering?
## logit(p[x]) = e[Plant[x],Site[x],Month[x]]
##
## #Observation of flowering|occurrence
## phi[x] = z[x] * p[x]
## Y[x] ~ dbern(phi[x])
##
## #Residuals
## discrepancy[x] <- abs(Y[x] - p[x])
##
## #Assess Model Fit
## Ynew[x] ~ dbern(phi[x])
## discrepancy.new[x]<-abs(Ynew[x] - phi[x])
## }
##
##
## #Sum discrepancy
## fit<-sum(discrepancy)/Nobs
## fitnew<-sum(discrepancy.new)/Nobs
##
## ###########
## #Prediction
## ###########
##
## for(x in 1:Npreds){
##
## #Occurrence at a given elevation
## logit(psi_new[x]) = alpha[Plant_new[x]] + beta[Plant_new[x]] * ele_new[x]
## z_new[x]~dbern(psi_new[x])
##
## logit(p_new[x]) <- e[Plant_new[x],Site_new[x],Month_new[x]]
##
## #Observation of flowering|occurrence
## phi_new[x] = z_new[x] * p_new[x]
##
## #Observation - probability of flowering
## prediction[x] ~ dbern(phi_new[x])
##
## #predictive error
## pred_error[x] <- abs(Ypred[x] - prediction[x])
## }
##
## #Predictive Error
## fitpred<-sum(pred_error)/Npreds
##
## #########################
## #Autocorrelation in error
## #########################
##
## #For each of observation
## for(x in 1:Sites){
## for(y in 1:Months){
## e[1:Plants,x,y] ~ dmnorm(zeros,tauC[,])
## }
## }
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda_cov * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter, allow omega to shrink to identity matrix
## vCov = omega*C[,] + (1-omega) * I
## tauC=vCov*gamma
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Prevalence
## alpha[j] ~ dnorm(0,0.386)
##
## #Effect of elevation on occurrence
## beta[j] ~ dnorm(0,0.386)
## }
##
## #Autocorrelation priors
## gamma ~ dunif(0.1,5)
##
## #Strength of covariance decay
## lambda_cov ~ dunif(0,5)
## omega = 1
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 2324
## Unobserved stochastic nodes: 5926
## Total graph size: 42696
##
## Initializing model
Mean interaction covariance
## sink("model/threshold_repulsion_elev.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #Occurrence at a given elevation
## logit(psi[x]) = alpha[Plant[x]] + beta[Plant[x]] * ele[x]
## z[x]~dbern(psi[x])
##
## #In Peak Flowering?
## logit(p[x]) = e[Plant[x],Site[x],Month[x]]
##
## #Observation of flowering|occurrence
## phi[x] = z[x] * p[x]
## Y[x] ~ dbern(phi[x])
##
## #Residuals
## discrepancy[x] <- abs(Y[x] - p[x])
##
## #Assess Model Fit
## Ynew[x] ~ dbern(phi[x])
## discrepancy.new[x]<-abs(Ynew[x] - phi[x])
## }
##
##
## #Sum discrepancy
## fit<-sum(discrepancy)/Nobs
## fitnew<-sum(discrepancy.new)/Nobs
##
## ###########
## #Prediction
## ###########
##
## for(x in 1:Npreds){
##
## #Occurrence at a given elevation
## logit(psi_new[x]) = alpha[Plant_new[x]] + beta[Plant_new[x]] * ele_new[x]
## z_new[x]~dbern(psi_new[x])
##
## logit(p_new[x]) <- e[Plant_new[x],Site_new[x],Month_new[x]]
##
## #Observation of flowering|occurrence
## phi_new[x] = z_new[x] * p_new[x]
##
## #Observation - probability of flowering
## prediction[x] ~ dbern(phi_new[x])
##
## #predictive error
## pred_error[x] <- abs(Ypred[x] - prediction[x])
## }
##
## #Predictive Error
## fitpred<-sum(pred_error)/Npreds
##
## #########################
## #Autocorrelation in error
## #########################
##
## #For each of observation
## for(x in 1:Sites){
## for(y in 1:Months){
## e[1:Plants,x,y] ~ dmnorm(zeros,tauC[,])
## }
## }
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda_cov * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter, allow omega to shrink to identity matrix
## vCov = omega*C[,] + (1-omega) * I
## tauC=vCov*gamma
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Prevalence
## alpha[j] ~ dnorm(0,0.386)
##
## #Effect of elevation on occurrence
## beta[j] ~ dnorm(0,0.386)
## }
##
## #Autocorrelation priors
## gamma ~ dunif(0.1,5)
##
## #Strength of covariance decay
## lambda_cov ~ dunif(0,5)
## omega = 1
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 2324
## Unobserved stochastic nodes: 5926
## Total graph size: 42696
##
## Initializing model
Mean interaction covariance martix
The probability of occurrence.
## Omega: The magnitude of the effect of autocorrelation on mean flowering occurrence
## # A tibble: 6 x 2
## Model p
## <chr> <dbl>
## 1 interaction_attraction 0
## 2 interaction_repulsion 0
## 3 phylogenetic_attraction 0.348
## 4 phylogenetic_repulsion 0
## 5 trait_attraction 0.586
## 6 trait_repulsion 0
| Model | mean | lower | upper |
|---|---|---|---|
| interaction_attraction | 0.4544230 | 0.4466245 | 0.4667826 |
| interaction_repulsion | 0.4275323 | 0.4143349 | 0.4430686 |
| phylogenetic_repulsion | 0.4184129 | 0.4100661 | 0.4257291 |
| trait_repulsion | 0.4124492 | 0.3992973 | 0.4232168 |
| trait_attraction | 0.1387448 | 0.1290637 | 0.1478888 |
| phylogenetic_attraction | 0.1370254 | 0.1254357 | 0.1487678 |
Without baseline
Zoom in
| Model | mean | lower | upper |
|---|---|---|---|
| baseline | 0.3095170 | 0.2517007 | 0.3639456 |
| trait_attraction | 0.2306156 | 0.2091837 | 0.2551020 |
| phylogenetic_attraction | 0.2303265 | 0.2057823 | 0.2551020 |
| interaction_attraction | 0.2267075 | 0.2023810 | 0.2500000 |
| interaction_repulsion | 0.2206259 | 0.1955782 | 0.2482993 |
| trait_repulsion | 0.2185612 | 0.1955782 | 0.2432823 |
| phylogenetic_repulsion | 0.2179728 | 0.1955782 | 0.2398810 |